package com.ghsc.ghxc.jsb.ui

import androidx.lifecycle.MutableLiveData
import com.cn.appcore.base.BaseViewModel
import com.cn.appcore.ext.executeResponse
import com.ghsc.ghxc.jsb.api.ApiMarket
import com.ghsc.ghxc.jsb.ui.bean.SysConfigResult
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext


class LaunchViewModel : BaseViewModel() {



    /**  配置 **/
    val onSysConfigData by lazy { MutableLiveData<SysConfigResult>() }
    fun onSysConfigMethod(paras: String) {
        launch {
            val response = withContext(Dispatchers.IO) { ApiMarket.service.onSysConfigData(paras) }
            executeResponse(
                response,
                { onSysConfigData.value = response.data },
                {
                    againLoginMsg.value = response.msg
                },
            ) { errorMsg.value = response.msg }
        }
    }


}